package com.kimi.commons;
/**
 * 统一响应结果工具类
 */
public class ResultUtils {
    public static <T> Result<T> success(T data) {
        return new Result<>(1,"success","成功",data);
    }
    public static Result success() {
        return new Result<>(1,"success","成功",null);
    }
    public static Result error(ErrorCode errorCode) {
        return new Result<>(errorCode);
    }
    public static Result error(ErrorCode errorCode, String msg,String desc) {
        return new Result<>(errorCode.getCode(),msg,desc,null);
    }
    public static Result error(int code, String msg, String desc) {
        return new Result<>(code,msg,desc,null);
    }
}
